/* eslint-disable import/no-anonymous-default-export */
import { get } from '@choerodon/inject';
import { hostApiConfig } from '@/api';

export default (projectId: any): any => ({
  autoCreate: false,
  autoQuery: false,
  selection: false,
  paging: false,
  transport: {
    read: () => {
      const configruation = get('configuration.routes.app_home_page:hostOptionsDataSet');
      if (configruation) {
        return configruation(projectId);
      }
      return hostApiConfig.loadHostsList();
    },
  },
});
